According to a related art, in order to improve reliability of NAND cells, data to be stored in the NAND cells are randomized. To randomize the data, a random number generator may be used. A random number generator of one type employs a linear feedback shift register that has a long period and good number randomness.